package com.helloniu.fl.util {

import mx.styles.StyleManager;
import mx.styles.CSSStyleDeclaration;

public class StyleTool {
	public function StyleTool() {
    }

	public static function setBtnStyle(btn:*, icon:String):void {
    	btn.setStyle("upSkin", getStyle(icon));
    	btn.setStyle("downSkin", getStyle(icon));
    	btn.setStyle("overSkin", getStyle(icon));
    	btn.setStyle("disabledSkin", getStyle(icon));
    }

	public static function setBtnDStyle(btn:*, icon:String):void {
    	btn.setStyle("disabledSkin", getStyle(icon));
    }
        
	public static function setBtnSStyle(btn:*, icon:String):void {
        btn.setStyle("selectedDisabledSkin", getStyle(icon));
        btn.setStyle("selectedDownSkin", getStyle(icon));
        btn.setStyle("selectedOverSkin", getStyle(icon));
        btn.setStyle("selectedUpSkin", getStyle(icon));
    }
    
	public static function setBtnSDStyle(btn:*, icon:String):void {
        btn.setStyle("selectedDisabledSkin", getStyle(icon));        
    }
    
	public static function getStyle(str:String):* {
        //new CSSStyleDeclaration("global");
    	var cssSD:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
    	return cssSD.getStyle(str);
    }
}
}